package com.smcdd.cdb.dbo.cdb_dbo.app;

import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;

import com.smcdd.cdb.dbo.cdb_dbo.zhhzxing.activity.ZXingLibrary;


/**
 * 作者：Administrator on 2017/6/9 11:43
 * 邮箱：zhanghuaiha@gmail.com
 */

public class App extends Application {

    public static Context mContext;
    /**
     * 初始化SP&EDIT
     */
    public static SharedPreferences SP;
    public static SharedPreferences.Editor EDIT;

    @Override
    public void onCreate() {
        super.onCreate();
        mContext = this;
        //初始化通用的SP&EDIT
        SP = getSharedPreferences("config", MODE_PRIVATE);
        EDIT = SP.edit();
        ZXingLibrary.initDisplayOpinion(this);
//        CrashHandler crashHandler = CrashHandler.getInstance();
//        crashHandler.init(this);
//        IntentFilter filter = new IntentFilter();
//        NetworkConnectChangedReceiver receiver = new NetworkConnectChangedReceiver();
//        filter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);
//        filter.addAction(WifiManager.WIFI_STATE_CHANGED_ACTION);
//        filter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
//        registerReceiver(receiver, filter);
//
//        receiver.setItemClickListenter(name -> {
//            if (name != null && name.contains("ChongDianDian")) {
//                ToastUtil.showToast("当前所连接的是设备wifi");
//            }
//        });

    }
}
